import java.util.Scanner;

public class Demo {


        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);

            // 读入自行车限重和总人数
            int bikeLimit = scanner.nextInt();
            int n = scanner.nextInt();

            // 读入每个人的体重，并计算需要的自行车数量
            int numBikes = 0;
            int totalWeight = 0;
            for (int i = 0; i < n; i++) {
                int weight = scanner.nextInt();
                totalWeight += weight;
                if (totalWeight > bikeLimit * 2) {
                    numBikes++;
                    totalWeight = weight;
                }
            }

            // 如果还有剩余的人员，需要再租用一辆自行车
            if (totalWeight > 0) {
                numBikes++;
            }

            // 输出结果
            System.out.println(numBikes);
        }

}
